<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div id="app">
        <!-- <input type="text" v-model="msg">
        <p>
            {{msg}}
        </p> -->
        <p>
            用户：
            <input type="text" v-model="data.user">
        </p>
        <p>
            密码:
            <input type="text" v-model="data.password">
        </p>
        <button @click="submit">提交</button>
    </div>
</body>
<script src="https://cdn.staticfile.org/vue/2.2.2/vue.min.js"></script>
<script>
    new Vue({
        el: "#app",
        data: {
            msg: "请输入用户名",
            data: {
                user: "",
                password: ""
            }
        },
        methods: {
            submit() {
                console.log(this.data);
            }
        },
    })

</script>

</html>